package sinoservices.hayden.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import sinoservices.hayden.bean.Userinfo;
import sinoservices.hayden.mapper.UserInfoMapper;
import sinoservices.hayden.service.UserInfoService;

import java.util.List;

@RestController
@Transactional
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public int saveUser(@RequestBody Userinfo userinfo) {
        return userInfoMapper.saveUser(userinfo);
    }

    @Override
    public int deleteUserById(int id) {
        return userInfoMapper.deleteUserById(id);
    }

    @Override
    public int updateUser(@RequestBody Userinfo userinfo) {
        return userInfoMapper.updateUser(userinfo);
    }

    @Override
    public Userinfo getUserInfo(int id) {
        return userInfoMapper.getUserInfo(id);
    }

    @Override
    public List<Userinfo> selectAllUser() {
        return userInfoMapper.selectAllUser();
    }
}
